@extends('layout.default')
@section('layout.content')
  <div class="row">
    <div class="col-xs-12">
      <form method="get" action="{{route('bank.user.apply')}}" class="form-horizontal">
        <div class="space-12"></div>
        <div class="col-xs-12 col-md-6 col-md-offset-3">
          <div class="form-group">
            <div class="input-group">
              <input type="text" class="form-control" id="query" name="query" maxlength="13"
                     placeholder="帐号/姓名" style="padding:0 10px;height:45px;font-size:18px;font-weight: bold;"
                     autocomplete="off"/>
              <span class="input-group-btn">
              <button class="btn btn-primary" id="btn-sign" type="submit" style="height:45px;font-size:14px;">
              <i class="ace-icon fa fa-search"></i>
              查询
              </button>
              <a href="{{route('bank.user.create')}}" class="btn btn-inverse"
                 style="height:45px;padding:10px 12px 0 16px;font-size:18px;">
                <i class="ace-icon fa fa-user-plus"></i>
              </a>
            </span>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div><!-- /.row -->
  <input type="hidden" name="aid" value="{{$activity->id}}"/>
  <div class="row">
    <div class="col-xs-12">
      <table id="user-list" class="table table-hover table-striped table-bordered">
        <thead>
        <tr>
          <th class="center">帐号</th>
          <th class="align-middle">姓名</th>
          <th class="center">签到</th>
          <th class="hidden-480 center">借阅</th>
          <th class="hidden-480 center">还书</th>
          <th class="center">积分</th>
          <th class="hidden-480 center">手机号码</th>
          <th class="hidden-480 center">登记日期</th>
          <th class="hidden-480 center">打印</th>
          <th class="center">签到</th>
          <th class="hidden-480 center">奖励</th>
        </tr>
        </thead>
        <tbody>
        @foreach ($users as $user)
          <tr>
            <td class="center"><a href="{{route('bank.user.edit',array('uid'=>$user->id))}}">{{ $user->account }}</a>
            </td>
            <td class="align-middle">{!! $user->present()->face !!} <a
                  href="{{route('bank.user.show',array('uid'=>$user->id))}}" class="uid"
                  data-id="{{ $user->id }}">{{ $user->name }}</a>
            </td>
            <td class="center b-sign">{{ $user->summary->signs }}</td>
            <td class="hidden-480 center b-borrow">{{ $user->summary->borrows }}</td>
            <td class="hidden-480 center b-return">{{ $user->summary->returns }}</td>
            <td class="center b-point">{{ $user->summary->points }}</td>
            <td class="hidden-480 center">{{ $user->mobile }}</td>
            <td class="hidden-480 center">{{ date('Y-m-d',$user->created_at) }}</td>
            <td class="hidden-480 center"><a href="{{route('bank.user.print',array('id'=>$user->id))}}"><i
                    class="ace-icon fa fa-print grey bigger-120"></i></a></td>
            <td class="center">{!! $user->present()->sign !!}</td>
            <td class="hidden-480 center">{!! $user->present()->award !!}</td>
          </tr>
        @endforeach
        </tbody>
      </table>
    </div>
  </div>
  <div class="row">
    <div class="col-xs-12">
      <div class="dataTables_paginate paging_bootstrap">{{ $users->links() }}</div>
    </div>
  </div>
@stop
@section('javascript')
  <script src="/assets/js/user-func.js"></script>
  <script type="text/javascript">
      $(function () {
          $('#query').focus();
      });
  </script>
@stop